package com.hl.sfzy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hl.sfzy.entity.Kechengshoucang;
import com.hl.sfzy.mapper.KechengshoucangMapper;
import com.hl.sfzy.service.KechengshoucangService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class KechengshoucangServiceImpl implements KechengshoucangService {

    @Autowired
    private KechengshoucangMapper kechengshoucangMapper;

    @Override
    public PageInfo<Kechengshoucang> findpage(int pageNum, int pageSize, Kechengshoucang kechengshoucang) {
        PageHelper.startPage(pageNum,pageSize);
        List<Kechengshoucang> list = kechengshoucangMapper.Select(kechengshoucang);
        PageInfo<Kechengshoucang> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public Kechengshoucang selectByPrimaryKey(Long id) {
        return kechengshoucangMapper.selectByPrimaryKey(id);
    }

    @Override
    public int deleteByPrimaryKey(Long id) {
        return kechengshoucangMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Kechengshoucang record) {
        return kechengshoucangMapper.insert(record);
    }

    @Override
    public int insertSelective(Kechengshoucang record) {
        return kechengshoucangMapper.insertSelective(record);
    }

    @Override
    public int updateByPrimaryKeySelective(Kechengshoucang record) {
        return kechengshoucangMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Kechengshoucang record) {
        return kechengshoucangMapper.updateByPrimaryKey(record);
    }
}
